/////////////////////////////////////////////////////////////////////////////
// Purpose:     Smart management of dynamic objects
// Author:      Jesus Gonzalez
// Modified by:
// Copyright:   (c) 2003-2013 Jesus Gonzalez <jgonzalez@gdr-sistemas.com>
// License:     BSD License
/////////////////////////////////////////////////////////////////////////////

#include "SmartLib/SmartPtr.h"

#if defined(_DEBUG_) && _SMARTPTR_DEBUG_ == 1

#include "Log.h"

void SmartObject::Reference()
{
	references++;
	LOG_ALLOC( "Reference incremented to %i in object %p",
	           references, this );
}
unsigned int SmartObject::Unreference()
{
	references--;
	LOG_ALLOC( "Reference decremented to %i in object %p",
	           references, this );
	return references;
}

SmartObject::~SmartObject()
{
	LOG_ALLOC( "Deleted object %p", this );
}

SmartObject::SmartObject() :
	references( 0 )
{
	LOG_ALLOC( "Created object %p", this );
}

#endif
